import sys
import logging
from datetime import datetime
from stock_a.label.stock_a_label_generator import StockLabelGenerator

if __name__ == '__main__':
    argv_list = sys.argv
    if len(argv_list) < 2:
        logging.error('Please input the biz_date. For example: python label_daily_executor.py 2025-01-26')
        sys.exit(-1)
    date = datetime.strptime(argv_list[1], '%Y-%m-%d').date()
    label_generator = StockLabelGenerator()
    # label_generator.clear_all_data()
    label_generator.init_tables()
    label_generator.build_or_update_label_20d(date)
    label_generator.build_or_update_label_50d(date)
    label_generator.build_or_update_label_120d(date)
